<template>
  <el-table
    stripe
    border
    :data="tableData"
    style="width: 100%"
  >
    
    <el-table-column
      prop="date"
      label="日期"
      width="180"
    />
    <!-- 
      想要自定义列 首先就要取消 prop 属性
    -->
    <el-table-column
      label="姓名"
      width="180"
    >
      <template #default="{ row }" >
        <el-tag type="success">
          {{ row.name }}
        </el-tag>
      </template>
    </el-table-column>
    <el-table-column
      prop="address"
      label="地址"
    />
  </el-table>
  <p></p>
</template>

<script lang="ts" setup>
  const tableData = [
    {
      date: '2024-11-03',
      name: 'lyc',
      address: 'Bit 113',
    },
    {
      date: '2016-05-02',
      name: 'Tom',
      address: 'No. 189, Grove St, Los Angeles',
    },
    {
      date: '2016-05-04',
      name: 'Tom',
      address: 'No. 189, Grove St, Los Angeles',
    },
    {
      date: '2016-05-01',
      name: 'Tom',
      address: 'No. 189, Grove St, Los Angeles',
    },
  ]
</script>